<template>
  <el-form :model="form"  ref="ruleForm2" label-width="100px" class="form">
    <h4>注册发验证码：</h4>
    <el-form-item label="手机号：">
      <el-input type="password" v-model="form.regMobile" auto-complete="off" class="inlineInput"></el-input>
      <el-button>提交</el-button>
    </el-form-item>
    <h4>更换交易密码验证码：</h4>
    <el-form-item label="用户ID：">
      <el-input type="password" v-model="form.changeDeal" auto-complete="off" class="inlineInput"></el-input>
      <el-button>提交</el-button>
    </el-form-item>
    <h4>更换登录密码验证码：</h4>
    <el-form-item label="用户ID：">
      <el-input v-model.number="form.changeLogin" class="inlineInput"></el-input>
      <el-button>提交</el-button>
    </el-form-item>
    <h4>更换手机号验证码：</h4>
    <el-form-item label="手机号：">
      <el-input v-model.number="form.changeMobile" class="inlineInput"></el-input>
      <el-button>提交</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
  export default {
  name: 'add-mobileMsg',
  data() {
    return {
      form: {
        regMobile:'',
        changeDeal:'',
        changeLogin:'',
        changeMobile:''
      }
    }
  },
  methods:{
    handleSave() {
      const form = this.form
      if (form.title === ''){
        this.$warn('请选择标题')
        return
      }
      if (form.content === ''){
        this.$warn('请填写内容')
        return
      }
      if (form.isUse.selVal === ''){
        this.$warn('请选择是否可用')
        return
      }
      // this.postBack()
    },
    handleSubmitBy(){

    },
    async postBack(){
      // 添加回访计划参数有问题
      try{
        const {sessionId} = this.$store.getters.getUserInfo
        const {mobile, telMsg} = this.$store.getters.callMsg
        let {date,content} = this.form
        date = dateFormat(date, 'YYYY-MM-DD HH:mm:ss')
        // const {cU_ser,dh} = this.$store.getters.telMsg
        const {cU_ser,dh} = telMsg
        const {data} = await this.$get(this,{
          api:'ajaxapi/addHfjl.do',
          data:{
            userName:cU_ser,
            sessionId,
            tel: mobile,
            hftime:date,
            beizhu:content,
            danhaoid:dh,
          }
        })
        if(data.state === 0 && data.content === true){
          this.$toast({
            message:'添加成功'
          })
          this.form = {
            date:'',
            content:'',
          }
          return
        }
        this.$warn('添加失败')
      }catch(e){
        this.$warn('系统接口ajaxapi/addHfjl.do报错')
      }
    }
  }
}
</script>

<style lang="scss" scoped>
  .form{
    width:450px;
  }
  .inlineInput{
    width:80% !important;
  }
</style>
